﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Article.Master" AutoEventWireup="true" CodeBehind="SearchArticle.aspx.cs" Inherits="TienTeTuong.SearchArticle" %>
<%@ Import Namespace="TienTeTuong" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
  <div class="mainArticleBgT">
       <div class="mainArticleBgB">
                    	<div class="mainTitle">Kết quả tìm kiếm - <%= iTotalResult %> kết quả</div>
                        
                        <div class="mainContent" >
                            
                            <% if (lstArticle.Count < 1)
                               {%>
                                       Không tìm thấy kết quả nào.
                            <% } %>
                            <% foreach (var val in lstArticle)
                               {
                                        
                              %>
                        	<div class="mainArticleTD"><table width="100%" cellpadding="0" cellspacing="0">
                            	<tr><td colspan="2" class="mainArticleTDTitle"><a href="articleDetail.aspx?id=<%=val.ArtID %>"><%= val.Title %></a></td></tr>
                            	<tr valign="top">
                                    <td><a href="articleDetail.aspx?id=<%=val.ArtID %>"><img src="<%= val.Image %>" class="mainArticleTDImg"/></a></td>
                                    <td>
                                    	<i><%= val.ShortDescript %></i><br />
										<%= Common.SplitContentAritcle(val.Content,224)%><br />
                                    	<a href="articleDetail.aspx?id=<%=val.ArtID %>">xem chi tiết</a>
                                    </td>
                                </tr>
                            </table></div>

                            <%  } %>
                        	
                        <!-- Page number -->
                              <!--Paging-->
                            <%if (iTotalPage > 1)
                              {%>
                               <div class="clear"></div>
                                 <div class="pageNumber">
                                
                            	<a href="SearchArticle.aspx?keyword=<%=keyword %>&page=1">&laquo; Trang đầu</a>
                                 <%for (var i = iLowerPage; i <= iUpperPage; i++)
                                {%>  
                                  <%if (i != iCurPage)
                                {%>
                                     <a href="SearchArticle.aspx?keyword=<%=keyword %>&page=<%=i.ToString() %>" class="Number"><%=i.ToString() %></a>
                                  <% } else{%>
                                     <a href="#" class="Current"><%=i.ToString() %></a>
                                 <% } %>
                                <% } %> 
                                <a href="SearchArticle.aspx?keyword=<%=keyword %>&page=<%= iTotalPage %>">Trang cuối &raquo;</a>

                                <div class="clear"></div>
                               </div>
                            <% } %>
                             <!--End Paging-->
                   
                        </div>
                     
                    </div>
   </div>   
</asp:Content>
